/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package SMA.models;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Emiliano
 */
@Entity
@Table(name = "TICKET")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Ticket.findAll", query = "SELECT t FROM Ticket t"),
    @NamedQuery(name = "Ticket.findByDescripcion", query = "SELECT t FROM Ticket t WHERE t.descripcion = :descripcion"),
    @NamedQuery(name = "Ticket.findByIdTicket", query = "SELECT t FROM Ticket t WHERE t.idTicket = :idTicket"),
    @NamedQuery(name = "Ticket.findByCalificacion", query = "SELECT t FROM Ticket t WHERE t.calificacion = :calificacion"),
    @NamedQuery(name = "Ticket.findByFolio", query = "SELECT t FROM Ticket t WHERE t.folio = :folio"),
    @NamedQuery(name = "Ticket.findByStatus", query = "SELECT t FROM Ticket t WHERE t.status = :status"),
    @NamedQuery(name = "Ticket.findByFecharegistro", query = "SELECT t FROM Ticket t WHERE t.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Ticket.findByFechacierre", query = "SELECT t FROM Ticket t WHERE t.fechacierre = :fechacierre"),
    @NamedQuery(name = "Ticket.findByIdDepartamento", query = "SELECT t FROM Ticket t WHERE t.idDepartamento = :idDepartamento"),
    @NamedQuery(name = "Ticket.findByResolvioproblema", query = "SELECT t FROM Ticket t WHERE t.resolvioproblema = :resolvioproblema")})
public class Ticket implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "DESCRIPCION")
    private String descripcion;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_TICKET")
    private Integer idTicket;
    @Column(name = "CALIFICACION")
    private Integer calificacion;
    @Column(name = "FOLIO")
    private Integer folio;
    @Column(name = "STATUS")
    private String status;
    @Column(name = "FECHAREGISTRO")
    @Temporal(TemporalType.DATE)
    private Date fecharegistro;
    @Column(name = "FECHACIERRE")
    @Temporal(TemporalType.DATE)
    private Date fechacierre;
    @Column(name = "ID_DEPARTAMENTO")
    private Integer idDepartamento;
    @Column(name = "RESOLVIOPROBLEMA")
    private Short resolvioproblema;
    @JoinColumn(name = "ID_USUARIO", referencedColumnName = "ID_USUARIO")
    @ManyToOne
    private Usuario idUsuario;
    @JoinColumn(name = "ID_TOPICOAYUDA", referencedColumnName = "ID_TOPICOAYUDA")
    @ManyToOne
    private TopicoAyuda idTopicoayuda;
    @JoinColumn(name = "ID_NIVELATENCION", referencedColumnName = "IDNIVELATECION")
    @ManyToOne
    private NivelAtencion idNivelatencion;
    @JoinColumn(name = "ID_CAUSASCERRARTICKET", referencedColumnName = "ID_CAUSASCERRARTICKET")
    @ManyToOne
    private CausaCerrarticket idCausascerrarticket;

    public Ticket() {
    }

    public Ticket(Integer idTicket) {
        this.idTicket = idTicket;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Integer getIdTicket() {
        return idTicket;
    }

    public void setIdTicket(Integer idTicket) {
        this.idTicket = idTicket;
    }

    public Integer getCalificacion() {
        return calificacion;
    }

    public void setCalificacion(Integer calificacion) {
        this.calificacion = calificacion;
    }

    public Integer getFolio() {
        return folio;
    }

    public void setFolio(Integer folio) {
        this.folio = folio;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public Date getFechacierre() {
        return fechacierre;
    }

    public void setFechacierre(Date fechacierre) {
        this.fechacierre = fechacierre;
    }

    public Integer getIdDepartamento() {
        return idDepartamento;
    }

    public void setIdDepartamento(Integer idDepartamento) {
        this.idDepartamento = idDepartamento;
    }

    public Short getResolvioproblema() {
        return resolvioproblema;
    }

    public void setResolvioproblema(Short resolvioproblema) {
        this.resolvioproblema = resolvioproblema;
    }

    public Usuario getIdUsuario() {
        return idUsuario;
    }

    public void setIdUsuario(Usuario idUsuario) {
        this.idUsuario = idUsuario;
    }

    public TopicoAyuda getIdTopicoayuda() {
        return idTopicoayuda;
    }

    public void setIdTopicoayuda(TopicoAyuda idTopicoayuda) {
        this.idTopicoayuda = idTopicoayuda;
    }

    public NivelAtencion getIdNivelatencion() {
        return idNivelatencion;
    }

    public void setIdNivelatencion(NivelAtencion idNivelatencion) {
        this.idNivelatencion = idNivelatencion;
    }

    public CausaCerrarticket getIdCausascerrarticket() {
        return idCausascerrarticket;
    }

    public void setIdCausascerrarticket(CausaCerrarticket idCausascerrarticket) {
        this.idCausascerrarticket = idCausascerrarticket;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTicket != null ? idTicket.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ticket)) {
            return false;
        }
        Ticket other = (Ticket) object;
        if ((this.idTicket == null && other.idTicket != null) || (this.idTicket != null && !this.idTicket.equals(other.idTicket))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "SMA.models.Ticket[ idTicket=" + idTicket + " ]";
    }
    
}
